package cn.mw.cmdb.enums;

public enum RecordLogErrorMethodType {
    doAdd("doAdd", "addRecordMethod"),
    doUpdate("doUpdate", "updateRecordMethod"),
    doRemove("doRemove", "removeRecordMethod"),
    doBatchAdd("doBatchAdd", "batchAddRecordMethod"),
    doBatchUpdate("doBatchUpdate", "batchUpdateRecordMethod"),
    doBatchRemove("doBatchRemove", "batchRemoveRecordMethod");

    private final String type;
    private final String desc;

    RecordLogErrorMethodType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public String getType() {
        return type;
    }

    public static String getMethodName(String type) {
        for (RecordLogErrorMethodType r : RecordLogErrorMethodType.values()) {
            if (r.getType().equals(type)) {
                return r.getDesc();
            }
        }
        return null;
    }
}
